//
//  CMDetailHeadView.m
//  项目三
//
//  Created by rimi1 on 2016/11/26.
//  Copyright © 2016年 Wangxingqian. All rights reserved.
//

#import "CMDetailHeadView.h"

static NSInteger spacing_ = 20;

@implementation CMDetailHeadView

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        [self addSubview:self.name];
        [self addSubview:self.imageView];
    }
    return self;
}

#pragma mark - get

- (UILabel *)name {
    
    if (!_name) {
        
        CGFloat spacing = WXQAdaptionWidth(spacing_ - 10);
        _name = [[UILabel alloc] initWithFrame:CGRectMake(spacing, CGRectGetMaxY(self.imageView.frame) + WXQAdaptionHeight(spacing_), kWIDTH - spacing * 2, WXQAdaptionHeight(22))];
        _name.font = [UIFont boldSystemFontOfSize:WXQAdaptionHeight(22)];
        _name.textAlignment = NSTextAlignmentCenter;
        
    }
    return _name;
}

- (UIImageView *)imageView {
    
    if (!_imageView) {
        
        _imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, kWIDTH, WXQAdaptionHeight(270))];
        
    }
    return _imageView;
}

@end











